package com.bm.jarquickstart.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.File;

/**
 * @author 港某
 * @datetime 2021/4/25 18:04
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
public class JarPackage {

    private String objId;
    private String name;
    private long updateTime;
    private long size;
    private String path;

    public JarPackage(Files files) {
        this.objId = files.getObjId();
        this.name = files.getFile().getName();
        this.updateTime = files.getFile().lastModified();
        this.size = files.getFile().length();
        this.path = files.getFile().getAbsolutePath();

    }

    public JarPackage(String objId, File file) {
        this.objId = objId;
        this.name = file.getName();
        this.updateTime = file.lastModified();
        this.size = file.length();
        this.path = file.getAbsolutePath();

    }


}
